import React, { Component } from "react";
import ReactDOM from "react-dom";
import { HashRouter, Switch, Route, NavLink } from "react-router-dom";
import { NoMatch, Header,ProductDetail,MIss } from "./Components";
import routes from "./router-config";
import { Provider,connect} from "react-redux";
import store from "./store/index";

ReactDOM.render(
  <Provider store={store}>
    <HashRouter>
      <div>
        <Header />
        <Switch>
          {routes.map((route, index) => (
            <Route
              key={index}
              path={route.path}
              component={route.component}
              exact={route.exact}
            />
          ))}
          <Route component={NoMatch} />
        </Switch>
      </div>
    </HashRouter>
  </Provider>,
  document.getElementById("main")
);
